package com.kaili.basic.service.impl;

import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.kaili.basic.mapper.ApplicationMapper;
import com.kaili.basic.pojo.dto.MdmApplicationModifyDto;
import com.kaili.basic.pojo.dto.MdmApplicationQueryDto;
import com.kaili.basic.pojo.entity.MdmApplication;
import com.kaili.basic.pojo.entity.MdmApplicationExport;
import com.kaili.basic.pojo.vo.MdmApplicationVo;
import com.kaili.basic.service.IApplicationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.ClassUtils;
import org.springframework.web.multipart.MultipartFile;

import java.io.File;
import java.io.IOException;
import java.util.List;
import java.util.Map;
import java.util.UUID;

/**
 *@Desc:应用管理接口实现类
 *@author:chenmengming
 *@Time: 19-7-25 3:26
 *@Copyright: @ 2019 杭州凯立通信有限公司 版权所有
 *@Warning 本内容仅限于公司内部传阅，禁止外泄或用于其他商业目的
 */
@Service
public class ApplicationServiceImpl extends ServiceImpl<ApplicationMapper, MdmApplication> implements IApplicationService {

    @Autowired
    private ApplicationMapper applicationMapper;


    @Override
    public int addMdmApplication(MdmApplication application) throws IOException {



        return applicationMapper.addMdmApplication(application);

    }

    @Override
    public int updateMdmApplication(MdmApplication mdmApplication) {
        return applicationMapper.updateMdmApplication(mdmApplication);
    }

    @Override
    public int deleteMdmApplication(Map<String,Object> map) {
        return applicationMapper.deleteMdmApplication(map);
    }

    @Override
    public List<MdmApplicationExport> getApplicationExport(MdmApplicationQueryDto mdmApplicationQueryDto) {
        return applicationMapper.getApplicationExport(mdmApplicationQueryDto);
    }

    @Override
    public MdmApplicationVo getMdmApplicationById(Integer id) {
        return applicationMapper.getMdmApplicationById(id);
    }

    @Override
    public MdmApplicationVo getMdmApplicationByappName(String appName) {
        return applicationMapper.getMdmApplicationByappName(appName);
    }



    @Override
    public List<MdmApplicationVo> getWhiteList() {
        return applicationMapper.getWhiteList();
    }

    @Override
    public List<MdmApplicationVo> getBlackList() {
        return applicationMapper.getBlackList();
    }

    @Override
    public Page<MdmApplicationVo> getMdmApplicationByKeywords(Page<MdmApplicationVo> page, MdmApplicationQueryDto dto) {
        List<MdmApplicationVo> mdmApplications=applicationMapper.getMdmApplicationByKeywords(page,dto);
        return page.setRecords(mdmApplications);
    }

    @Override
    public List<MdmApplicationVo> getMdmApplicationInfo(MdmApplicationQueryDto dto) {
        return applicationMapper.getMdmApplicationInfo(dto);
    }
}
